package com.bw.service.impl;

import com.bw.dao.AccountantDao;
import com.bw.entity.Accountant;
import com.bw.service.AccountantService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AccountantServiceImpl implements AccountantService {
  @Autowired
  AccountantDao accountantDao;


  @Override
  public PageInfo<Accountant> list(Accountant accountant, Integer pageNum, Integer pageSize) {
    PageHelper.startPage(pageNum,pageSize);
    List<Accountant> list=accountantDao.list(accountant);
    PageInfo<Accountant> info = new PageInfo<>(list);
    return info;
  }

  @Override
  public int add(Accountant accountant) {
    return accountantDao.add(accountant);
  }

  @Override
  public List<Accountant> selectType() {
    return accountantDao.selectType();
  }

  @Override
  public int deleteByid(Integer[] arr) {
    return accountantDao.deleteByid(arr);
  }
}
